package byteStream;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class InputStream1 {
	public static void main(String[] args) throws FileNotFoundException {
		
			InputStream is=new FileInputStream("mydoc/a.txt");
			try {
				int n=is.available();
				p(n);
				byte[] by=new byte[1024];
				is.read(by);
				for (int i = 0; i <n; i++) {
					p((char)by[i]);
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	}
    static void p(Object o){
    	System.out.println(o);
    }
}
